﻿using QFramework;
using UnityEngine;

namespace HKTools
{
    public class CMD_TCP_SendMsgC2S : AbstractCommand
    {
        string msg;

        public CMD_TCP_SendMsgC2S(string _msg)
        {
            msg = _msg;
        }

        protected override void OnExecute()
        {
            IHK_TcpClientSystem tcpClientSystem = this.GetSystem<IHK_TcpClientSystem>();

            if (!tcpClientSystem.IsClientRunning)
            {
                Debug.LogError("当前 Client端，无法使用该指令！");
                return;
            }
            else
            {
                tcpClientSystem.SendMsg_ClientToServer(msg);
            }
        }
    }
}